import { createSlice } from '@reduxjs/toolkit';
import i18n from '../i18n';

const languageSlice = createSlice({
  name: 'language',
  initialState: i18n.language || 'zh_CN',
  reducers: {
    setLanguage: (state, action) => {
      return action.payload;
    },
  },
});

export const { setLanguage } = languageSlice.actions;
export default languageSlice.reducer; 